package cn.xuziao.databasecourse.service;

import cn.xuziao.databasecourse.tools.InitData;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Random;

/**
 * @author xuziao
 * @date 2021/12/1 17:05
 */

@Service
public class OssHandle {
    public String getRandomInfoUrl(String content) {
        InitData initData = new InitData();
        List<String> images = initData.getUrls("databasecourse/"+content+"/");
        //不要越界了！！！！
        return images.get(new Random().nextInt(images.size()-1) + 1);
    }

}
